package com.ruoyi.project.good.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.good.mapper.GoodsAssembleMapper;
import com.ruoyi.project.good.domain.GoodsAssemble;
import com.ruoyi.project.good.service.IGoodsAssembleService;

/**
 * 商品拼团配置Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-01
 */
@Service
public class GoodsAssembleServiceImpl implements IGoodsAssembleService 
{
    @Autowired
    private GoodsAssembleMapper goodsAssembleMapper;

    /**
     * 查询商品拼团配置
     * 
     * @param assembleId 商品拼团配置ID
     * @return 商品拼团配置
     */
    @Override
    public GoodsAssemble selectGoodsAssembleById(Long assembleId)
    {
        return goodsAssembleMapper.selectGoodsAssembleById(assembleId);
    }

    /**
     * 查询商品拼团配置列表
     * 
     * @param goodsAssemble 商品拼团配置
     * @return 商品拼团配置
     */
    @Override
    public List<GoodsAssemble> selectGoodsAssembleList(GoodsAssemble goodsAssemble)
    {
        return goodsAssembleMapper.selectGoodsAssembleList(goodsAssemble);
    }

    /**
     * 新增商品拼团配置
     * 
     * @param goodsAssemble 商品拼团配置
     * @return 结果
     */
    @Override
    public int insertGoodsAssemble(GoodsAssemble goodsAssemble)
    {
        goodsAssemble.setCreateTime(DateUtils.getNowDate());
        return goodsAssembleMapper.insertGoodsAssemble(goodsAssemble);
    }

    /**
     * 修改商品拼团配置
     * 
     * @param goodsAssemble 商品拼团配置
     * @return 结果
     */
    @Override
    public int updateGoodsAssemble(GoodsAssemble goodsAssemble)
    {
        return goodsAssembleMapper.updateGoodsAssemble(goodsAssemble);
    }

    /**
     * 批量删除商品拼团配置
     * 
     * @param assembleIds 需要删除的商品拼团配置ID
     * @return 结果
     */
    @Override
    public int deleteGoodsAssembleByIds(Long[] assembleIds)
    {
        return goodsAssembleMapper.deleteGoodsAssembleByIds(assembleIds);
    }

    /**
     * 删除商品拼团配置信息
     * 
     * @param assembleId 商品拼团配置ID
     * @return 结果
     */
    @Override
    public int deleteGoodsAssembleById(Long assembleId)
    {
        return goodsAssembleMapper.deleteGoodsAssembleById(assembleId);
    }
}
